package GOrden.mobile;

import java.util.List;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class AdaptadorTitulares extends ArrayAdapter {
	private final Activity context;
	private final List<Lista> datos;

	AdaptadorTitulares(Activity context, List<Lista> objects) {
		super(context, R.layout.menu_ppal_item, objects);
		this.context = context;
		this.datos = objects;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		LayoutInflater inflater = context.getLayoutInflater();
		View item = inflater.inflate(R.layout.menu_ppal_item, null);

		Lista actual = datos.get(position);
		TextView lblTitulo = (TextView) item.findViewById(R.id.LblTitulo);
		lblTitulo.setText(actual.getTitulo());

		TextView lblSubtitulo = (TextView) item.findViewById(R.id.LblSubTitulo);
		lblSubtitulo.setText(actual.getSubtitulo());

		return (item);
	}
}